package pers.whj.net.local.exception;

public class WHJException extends Exception {
    protected final ErrorCode ERROR_CODE;

    public WHJException() {
        super(ErrorCodeEnum.UNSPECIFIED.getDescription());
        this.ERROR_CODE = ErrorCodeEnum.UNSPECIFIED;
    }

    public WHJException(final ErrorCode errorCode) {
        super(errorCode.getDescription());
        this.ERROR_CODE = errorCode;
    }

    public WHJException(String message) {
        super(message);
        this.ERROR_CODE = ErrorCodeEnum.UNSPECIFIED;
    }

    public WHJException(Throwable cause) {
        super(cause);
        this.ERROR_CODE = ErrorCodeEnum.UNSPECIFIED;
    }

    public ErrorCode getErrorCode() {
        return ERROR_CODE;
    }
}